<?php
namespace App\Module\Admin\Controller;

use App\Common\Controller\AbstractController;
use App\Module\Admin\Request\Score\DecreaseRequest;
use App\Module\Admin\Service\ScoreService;
use Hyperf\Di\Annotation\Inject;

class ScoreController extends AbstractController{

    /**
     * @Inject()
     * @var ScoreService $scoreService
     */
    private $scoreService;

    public function search(){
        $user_id = $this->request->input("user_id");
        $origin = $this->request->input("origin");
        $pagesize = $this->request->input("pagesize");

        return $this->response->json($this->scoreService->search($user_id,$origin,$pagesize));
    }

    public function decrease(DecreaseRequest $request){
        return $this->response->json($this->scoreService->decrease($request));
    }
}